package org.lalib.controller.form;

import java.util.ArrayList;
import java.util.List;

import javax.faces.bean.SessionScoped;
import javax.faces.model.SelectItem;

import org.lalib.acquire.IControllerForm;
import org.lalib.entity.object.ECategory;
import org.primefaces.model.TreeNode;
import org.springframework.stereotype.Controller;

@SessionScoped
@Controller(value = "cCategoryForm")
public class CCategoryForm implements IControllerForm {

	private static final long serialVersionUID = 1L;
	private TreeNode selectedNode;
	private TreeNode rootNode;
	private ECategory selectedCategory;
	private ECategory newCategory;
	private List<SelectItem> selectItemList = new ArrayList<SelectItem>();
	private Long selectedCategoryId;
	private Long parentId = (long) 0;

	private boolean editPanel = false;

	public TreeNode getRootNode() {
		return rootNode;
	}

	public void setRootNode(TreeNode rootNode) {
		this.rootNode = rootNode;
	}

	public TreeNode getSelectedNode() {
		return selectedNode;
	}

	public void setSelectedNode(TreeNode selectedNode) {
		this.selectedNode = selectedNode;
	}

	public ECategory getSelectedCategory() {
		return selectedCategory;
	}

	public void setSelectedCategory(ECategory selectedCategory) {
		this.selectedCategory = selectedCategory;
	}

	public ECategory getNewCategory() {
		return newCategory;
	}

	public void setNewCategory(ECategory newCategory) {
		this.newCategory = newCategory;
	}

	public boolean isEditPanel() {
		return editPanel;
	}

	public void setEditPanel(boolean editPanel) {
		this.editPanel = editPanel;
	}

	public List<SelectItem> getSelectItemList() {
		return selectItemList;
	}

	public void setSelectItemList(List<SelectItem> selectItemList) {
		this.selectItemList = selectItemList;
	}

	public Long getParentId() {
		return parentId;
	}

	public void setParentId(Long parentId) {
		this.parentId = parentId;
	}

	public Long getSelectedCategoryId() {
		return selectedCategoryId;
	}

	public void setSelectedCategoryId(Long selectedCategoryId) {
		this.selectedCategoryId = selectedCategoryId;
	}
}
